<?php

class pdo1{

    public static function show(){
$conn = new PDO('mysql:host=localhost;dbname=php','root','root');

$conn->query('SET NAMES UTF8');

$rs = $conn->query("select * from user");

while($row = $rs->fetch(PDO::FETCH_OBJ)){
    
    $rows[] = $row;
    
}


echo count($rows);
foreach ($rows as $r){
    
    echo $r->username;
    
       }

    }

}

pdo1::show();
?>